Skip to content

Context center feedbacks 2 - #28436

Merged
Rohit0301 merged 9 commits into
mainfrom
context-center-feedbacks-2
May 27, 2026
Merged

Rohit0301 merged 9 commits into
mainfrom
context-center-feedbacks-2

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented May 26, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #

Screen.Recording.2026-05-27.at.12.15.13.PM.mov
Screen.Recording.2026-05-27.at.12.19.00.PM.mov

I worked on ... because ...

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

High-level design:

N/A — small change.

Tests:

Use cases covered

Unit tests

Backend integration tests

Ingestion integration tests

Playwright (UI) tests

Manual testing performed

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • For UI changes: I attached a screen recording and/or screenshots above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

Summary by Gitar

  • Context Center Memories Improvements:
    • Added read-only state and warning banner in CreateMemoryModal for non-owners, with localized messaging.
    • Enhanced MemoryRow actions to include explicit edit and delete buttons, ensuring only owners can modify or delete their memories.
    • Updated MemoriesView to conditionally hide actions for non-owners and integrated currentUserName context.
    • Updated owner logic across CreateMemoryModal and MemoriesView to support isAdminUser permissions and multi-owner arrays.
  • UI/Localization Updates:
    • Updated language files with new keys for cant-edit-this-memory and context-memory-read-only-description.
    • Refined visibility badge icons using VISIBILITY_ICON_MAP for better consistency in CreateMemoryModal.
    • Cleaned up redundant onEditMemory prop logic in MemoryActions interface and components.
    • Standardized success message keys in CreateMemoryModal and ContextCenterMemoriesPage.
  • Component Exports:
    • Added FileIcon export from @untitledui/file-icons in file-upload.tsx.

This will update automatically on new commits.

@Rohit0301
Rohit0301 requested review from a team, chirag-madlani and karanh37 as code owners May 26, 2026 11:31
@Rohit0301
Rohit0301 force-pushed the context-center-feedbacks-2 branch from 886913a to db9b1f0 Compare May 26, 2026 13:27
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@gitar-bot

gitar-bot Bot commented May 26, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 1 resolved / 3 findings

Refines the Context Center interface by adding visibility configurations, quick link support, and improved file upload handling. The upload loading state is now correctly reset on failure, though the visibility modal remains prone to state inconsistencies during cancellation.

💡 Bug: Visibility cancel resets to previous but doesn't restore original value

📄 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/CreateMemoryModal/CreateMemoryModal.component.tsx:629-631

In CreateMemoryModal, when the user clicks 'Cancel' on the visibility edit (line 630-631), setIsEditingVisibility(false) is called but the visibility state retains whatever the user selected in the dropdown. The original visibility value from memoryToEdit is not restored. This means if a user opens the visibility editor, changes it, then cancels, the new (unsaved) value persists in the form until the modal is closed.

Restore the original visibility value when cancelling the inline edit.
<Button
  color="secondary"
  size="sm"
  onClick={() => {
    setVisibility(memoryToEdit?.visibility ?? ShareVisibility.Shared);
    setIsEditingVisibility(false);
  }}>
  {t('label.cancel')}
</Button>
💡 Quality: Missing newline at end of ContextCenter.constants.ts

📄 openmetadata-ui/src/main/resources/ui/src/constants/ContextCenter.constants.ts:44

The file ContextCenter.constants.ts is missing a trailing newline (shown by the \ No newline at end of file marker in the diff). This can cause noise in future diffs and some linters flag it.

✅ 1 resolved
✅ Bug: handleAttach never resets isUploading when all uploads fail

📄 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/UploadDocumentModal/UploadDocumentModal.component.tsx:115-129
In handleAttach, setIsUploading(false) is called only inside the if (!cancelledRef.current) block at line 138. However, when batchAssets.length === 0 (all files failed), the function resets isUploading to false but doesn't close the modal or give the user a way to retry — this is acceptable. But if cancelledRef.current becomes true mid-loop (user closes the modal), handleClose() already resets state.

The real issue: when cancelledRef.current is false but all uploads fail, setIsUploading(false) IS called (line 138), so the button re-enables. However, the failed files now have status: 'error' so hasPendingFiles (line 47-49) will be false and the Attach button stays disabled. The user can only retry individual files or remove them. This is correct behavior.

Actually, re-reading more carefully: setIsUploading(false) at line 138 is inside if (!cancelledRef.current) which covers the all-failed case. The concern is when cancelledRef.current is true (user cancelled) — but handleClose resets isUploading. So this is fine.

Wait — actually there IS a bug: if the user doesn't close the modal but the loop is cancelled via cancelledRef, setIsUploading(false) is never called. But cancelledRef.current = true is only set in handleClose, which already calls setIsUploading(false). So this is safe.

Let me reconsider: The actual bug is that after all uploads fail, the files' statuses are set to 'error' by uploadSingleFile. The pending array was computed before the loop, and those entries still exist in files state but now with status: 'error'. So hasPendingFiles becomes false, the Attach button is disabled, and isUploading is false. The user sees failed items with retry buttons. This seems intentional.

I'll downgrade this — actually looking again at the code flow, the setIsUploading(false) at line 138 IS reached when all uploads fail (cancelledRef is false). So there's no stuck state. I'll remove this finding.

🤖 Prompt for agents
Code Review: Refines the Context Center interface by adding visibility configurations, quick link support, and improved file upload handling. The upload loading state is now correctly reset on failure, though the visibility modal remains prone to state inconsistencies during cancellation.

1. 💡 Bug: Visibility cancel resets to previous but doesn't restore original value
   Files: openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/CreateMemoryModal/CreateMemoryModal.component.tsx:629-631

   In CreateMemoryModal, when the user clicks 'Cancel' on the visibility edit (line 630-631), `setIsEditingVisibility(false)` is called but the `visibility` state retains whatever the user selected in the dropdown. The original visibility value from `memoryToEdit` is not restored. This means if a user opens the visibility editor, changes it, then cancels, the new (unsaved) value persists in the form until the modal is closed.

   Fix (Restore the original visibility value when cancelling the inline edit.):
   <Button
     color="secondary"
     size="sm"
     onClick={() => {
       setVisibility(memoryToEdit?.visibility ?? ShareVisibility.Shared);
       setIsEditingVisibility(false);
     }}>
     {t('label.cancel')}
   </Button>

2. 💡 Quality: Missing newline at end of ContextCenter.constants.ts
   Files: openmetadata-ui/src/main/resources/ui/src/constants/ContextCenter.constants.ts:44

   The file `ContextCenter.constants.ts` is missing a trailing newline (shown by the `\ No newline at end of file` marker in the diff). This can cause noise in future diffs and some linters flag it.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions

github-actions Bot commented May 26, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
63.09% (66606/105570) 43.97% (36555/83135) 46.12% (10836/23492)

@Rohit0301
Rohit0301 force-pushed the context-center-feedbacks-2 branch from 279788f to d105bf8 Compare May 26, 2026 17:49
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (14 flaky)

✅ 4248 passed · ❌ 0 failed · 🟡 14 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
✅ Shard 1 299 0 0 4
🟡 Shard 2 801 0 2 9
🟡 Shard 3 801 0 2 8
🟡 Shard 4 843 0 2 12
✅ Shard 5 719 0 0 47
🟡 Shard 6 785 0 8 8
🟡 14 flaky test(s) (passed on retry)
  • Features/DataQuality/DataQuality.spec.ts › TestCase filters (shard 2, 1 retry)
  • Features/Glossary/LargeGlossaryPerformance.spec.ts › should expand and collapse all terms (shard 2, 1 retry)
  • Features/KnowledgeCenter.spec.ts › Article mentions in description should working for Knowledge Center (shard 3, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Pages/CustomProperties.spec.ts › Timestamp (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Table (shard 4, 1 retry)
  • Pages/ExploreTree.spec.ts › Explore Tree (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/Lineage/PlatformLineage.spec.ts › Verify domain platform view (shard 6, 1 retry)
  • Pages/Login.spec.ts › Refresh should work (shard 6, 1 retry)
  • Pages/ServiceEntity.spec.ts › Announcement create, edit & delete (shard 6, 1 retry)
  • Pages/UserDetails.spec.ts › Create team with domain and verify visibility of inherited domain in user profile after team removal (shard 6, 1 retry)
  • Pages/Users.spec.ts › Admin soft & hard delete and restore user (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@Rohit0301
Rohit0301 merged commit 502bb99 into main May 27, 2026
49 checks passed
@Rohit0301
Rohit0301 deleted the context-center-feedbacks-2 branch May 27, 2026 08:22
@gitar-bot

gitar-bot Bot commented May 27, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 5 resolved / 5 findings

Enhances the Context Center memories feature by implementing proper ownership checks, adding UI feedback for non-owners, and standardizing visibility icons. No issues found after addressing linting, visibility badge logic, and access controls.

✅ 5 resolved
✅ Bug: handleAttach never resets isUploading when all uploads fail

📄 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/UploadDocumentModal/UploadDocumentModal.component.tsx:115-129
In handleAttach, setIsUploading(false) is called only inside the if (!cancelledRef.current) block at line 138. However, when batchAssets.length === 0 (all files failed), the function resets isUploading to false but doesn't close the modal or give the user a way to retry — this is acceptable. But if cancelledRef.current becomes true mid-loop (user closes the modal), handleClose() already resets state.

The real issue: when cancelledRef.current is false but all uploads fail, setIsUploading(false) IS called (line 138), so the button re-enables. However, the failed files now have status: 'error' so hasPendingFiles (line 47-49) will be false and the Attach button stays disabled. The user can only retry individual files or remove them. This is correct behavior.

Actually, re-reading more carefully: setIsUploading(false) at line 138 is inside if (!cancelledRef.current) which covers the all-failed case. The concern is when cancelledRef.current is true (user cancelled) — but handleClose resets isUploading. So this is fine.

Wait — actually there IS a bug: if the user doesn't close the modal but the loop is cancelled via cancelledRef, setIsUploading(false) is never called. But cancelledRef.current = true is only set in handleClose, which already calls setIsUploading(false). So this is safe.

Let me reconsider: The actual bug is that after all uploads fail, the files' statuses are set to 'error' by uploadSingleFile. The pending array was computed before the loop, and those entries still exist in files state but now with status: 'error'. So hasPendingFiles becomes false, the Attach button is disabled, and isUploading is false. The user sees failed items with retry buttons. This seems intentional.

I'll downgrade this — actually looking again at the code flow, the setIsUploading(false) at line 138 IS reached when all uploads fail (cancelledRef is false). So there's no stuck state. I'll remove this finding.

✅ Quality: Missing newline at end of ContextCenter.constants.ts

📄 openmetadata-ui/src/main/resources/ui/src/constants/ContextCenter.constants.ts:44
The file ContextCenter.constants.ts is missing a trailing newline (shown by the \ No newline at end of file marker in the diff). This can cause noise in future diffs and some linters flag it.

✅ Bug: Ownership check uses updatedBy instead of a stable creator field

📄 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/MemoriesView/MemoriesView.component.tsx:121 📄 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/CreateMemoryModal/CreateMemoryModal.component.tsx:469 📄 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/CreateMemoryModal/CreateMemoryModal.component.tsx:485
Both MemoryRow (line 121) and CreateMemoryModal (line 202-204) determine ownership via memory.updatedBy === currentUserName. The updatedBy field reflects whoever last modified the record, not the original creator. If a workspace admin edits a memory, updatedBy changes to the admin's name, causing the original owner to lose edit/delete access in the UI. Additionally, the read-only banner (line 485) labels updatedBy as "the creator", which would display the wrong name after an admin edit.

Consider using a dedicated createdBy field (or the owners array already present in MemoryItem) for ownership determination. If the API doesn't provide createdBy, the owners field seems more appropriate.

✅ Performance: VISIBILITY_ICON_MAP recreated on every render inside component

📄 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/CreateMemoryModal/CreateMemoryModal.component.tsx:408-412
The VISIBILITY_ICON_MAP object (lines 408-412) is defined inside the component body, creating new React elements on every render. Since the icons are static, this map should either be moved outside the component or wrapped in useMemo.

✅ Bug: Visibility cancel resets to previous but doesn't restore original value

📄 openmetadata-ui/src/main/resources/ui/src/components/ContextCenter/CreateMemoryModal/CreateMemoryModal.component.tsx:629-631
In CreateMemoryModal, when the user clicks 'Cancel' on the visibility edit (line 630-631), setIsEditingVisibility(false) is called but the visibility state retains whatever the user selected in the dropdown. The original visibility value from memoryToEdit is not restored. This means if a user opens the visibility editor, changes it, then cancels, the new (unsaved) value persists in the form until the modal is closed.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

This branch was previously deployed

1 inactive deployment
test — f70a8bdd Deployed May 26, 2026 by Rohit0301 via playwright-ci-postgresql (5, 6) #48666
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants